<?php
class Employee {
	private $name;
	public $city;
	protected $wage;
	
	function __get($propName) {
		echo "__get($propName) called!";
		echo "\n";
		
		$vars = array("name", "city");
		
		if (in_array($propName, $vars)){
			return $this->$propName;
		}else {
			return "No such variable!";
		}
	}
	
	function work(){}
}
// Function for class 
$StrClassName = "Employee";


echo class_exists($StrClassName) ."\n";		//boolean


$employee = new Employee();
echo get_class($employee) ."\n";			//string


$arr1 = get_class_methods($StrClassName);		//array method name
foreach ($arr1 as $key => $value) {		
	echo "$key : $value \n";
}

$arr1 = get_class_vars($StrClassName);		//array public attribute names
foreach ($arr1 as $key => $value) {		
	echo "$key : $value \n";
}


$arr1 = get_declared_classes();				//array 
foreach ($arr1 as $key => $value) {		
	echo "$key : $value \n";
}


// Function for object 
$str2 = get_object_vars($employee);
echo "object vars: $str2 \n";


$str2 = get_parent_class($employee);
echo "parent class: $str2 \n";



echo "is a: " .is_a($employee, $StrClassName) ."\n";


echo "subclass: " .is_subclass_of($employee, $StrClassName) ."\n";


echo "method exist: " .method_exists($employee, "work");
?>